from pyramid.config import Configurator

import json
import xlwt
import xlrd
import xlutils
from xlutils.copy import copy
from xlwt import Style, XFStyle, Borders, Pattern, easyxf
import mimetypes


# Configure and start the server:
def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application."""
    config = Configurator(settings=settings)
    config.add_static_view('static', 'static', cache_max_age=3600)
    config.add_route('main_view', '/')
    config.add_route('analyze_calendar', '/analyze_calendar')
    config.add_route('export_calendar', '/export_calendar')
    config.add_route('oauth2callback', '/oauth2callback')
    config.add_route('process_google_auth', '/process_google_auth')
    config.add_route('excel_calendar', '/excel_calendar')
    config.add_route('analysis', '/analysis')

    config.add_route('reswell_view', '/reswell')
    config.add_route('query_fdb', '/reswell/query_fdb')

    config.scan()
    return config.make_wsgi_app()
